import request from "@/utils/request";

// 获取组织架构的部门信息
export function getDepartments() {
  return request({
    url: "/company/department",
  });
}

// 删除部门
export function DeleteDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: "delete", //接口满足resfull接口规范
  });
}

//添加部门
export function addDepartments(data) {
  return request({
    url: "/company/department",
    method: "post",
    data,
  });
}

//获取部门详情
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`,
  });
}

// 保存编辑功能
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: "put",
    data,
  });
}
